/**
 * Created by asus on 2017/5/6.
 */
require(["jquery", "template", "bbcare"], function ($, template, $bb) {
    var URL = $bb.baseUrl("department");
    $bb.ajax({
        url: URL + "followup/service/education/template/list",
        type: "post",
        contentType: "application/json;charset=UTF-8",
        dataType: "json",
        data: JSON.stringify({
            data: {}
        }),
        success: function (data) {
            for (var i = 0; i < data.rows.length; i++) {
                $(".allMission").append(data.rows[i].templateContent);
            }
            $(".allMission >div").each(function (i) {
                $(this).attr("id", data.rows[i].id);
            })
            $(".allMission >div").click(function () {
                $bb.openPage("useMission", $(this).attr("id"));
            })
        },
        error: function (data) {
            console.log('请求出错' + data);
        }
    });

});